From: Eli Zaretskii Date: Mon, 2 Feb 2004 20:51:18 +0000 (+0000) Subject: (Fcopy_file): If NEWNAME is a directory, expand the X-Git-Tag: archive/raspbian/1%29.2+1-2+rpi1~1^2~24296 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:///%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:/?a=commitdiff_plain;h=f7f847adff7d819c6f1df5472b8c59e8375c60b2;p=emacs.git (Fcopy_file): If NEWNAME is a directory, expand the basename of FILE relative to it, not FILE itself. --- diff --git a/src/fileio.c b/src/fileio.c index c7959b3672d..73771591994 100644 --- a/src/fileio.c +++ b/src/fileio.c @@ -2407,7 +2407,7 @@ Also set the file modes of the target file to match the source file. */) CHECK_STRING (newname); if (!NILP (Ffile_directory_p (newname))) - newname = Fexpand_file_name (file, newname); + newname = Fexpand_file_name (Ffile_name_nondirectory (file), newname); else newname = Fexpand_file_name (newname, Qnil);